<?php
// +----------------------------------------------------------------------
// | 票付通演出类场馆列表
// +----------------------------------------------------------------------
// | Author: TongBC <501468940@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/06/10
// +----------------------------------------------------------------------
// | www.12301.cc/pft_show.html?m=venue_list
// +----------------------------------------------------------------------
include_once '/var/www/html/new/d/module/common/Db.class.php';
$dbConf = include '/var/www/html/new/d/module/common/db.conf.php';// 远端服务器配置信息

use \PFT\Db;
Db::Conf($dbConf['remote_1']);


include 'PftShow.class.php';
$pdo = Db::Connect();
$obj = new \PFT\Show\PftShow($pdo);
$use_date = base64_decode($_GET['d']);
$venus_id = abs($_GET['i']);
$params = array(
    'apply_did' => $_SESSION['sid'],
    'venus_id'  => $venus_id,
    'use_date'  => $use_date,
);

//选择该场馆已有的日期
$sql = "SELECT use_date FROM pft_round WHERE venus_id=? AND status=0 GROUP BY use_date";
$stmt = $pdo->prepare($sql);
$stmt->execute(array($venus_id));
$json = array();
while($row=$stmt->fetch(PDO::FETCH_ASSOC)) {
    if (!$row['use_date']) continue;
    $timestamp= (int)$row['use_date'];
    $json[] = $row['use_date'];
//    $json[] = array(
//        'date'=> "moment({$row['use_date']}').valueOf()",
//        'css'=>'holiday',
//        'selectable'=> false,
//        'title'=> '已设置场次',
//    );
}
//echo json_encode($json);
//$use_date_list = $stmt->fetchAll(PDO::FETCH_COLUMN);
//print_r($use_date_list);
//echo json_encode($use_date_list);
$rounds = $obj->GetRoundListByDate($params);
//print_r($rounds);
//print_r($rounds);
//$rounds = array(
//    array(
//        'round_name'=>'ccc',
//        'bt'=>'10:10',
//        'et'=>'10:50',
//        'zone_id'=>1,
//        'id'=>1
//    ),
//);
include ROOT_PATH . 'tpl/pft_show/round_sync.html';